<template>
	<view class="wrap-publisher flex align-center just-between" v-if="dataInfo">
		<view class="file">
			<block v-if="dataInfo.user_id === null || dataInfo.user_id == 0">
				<image class="file" :src="$staticImagePath('home/logo.png')" />
			</block>

			<block v-else>
				<image
					class="file"
					:src="$getImageURL(dataInfo.is_shop == 1 ? dataInfo.shop.avatar : dataInfo.user.avatar)"
				/>
			</block>
		</view>

		<view class="info">
			<view class="title limit-num-line fBold f-30">
				{{
					(dataInfo.user_id === null || dataInfo.user_id == 0)
						? dataInfo.platform_prompt
						: dataInfo.is_shop == 1
						? dataInfo.shop.shopname
						: dataInfo.user.nickname
				}}
			</view>
		</view>

		<button class="btn flex align-center" hover-class="none" open-type="share">
			<image class="share" :src="$staticImagePath('article/share.png')" />

			<view class="f-24">分享</view>
		</button>
	</view>
</template>

<script>
	export default {
		props: {
			/**
			 * 数据
			 */
			dataInfo: {
				type: Object,
				default: null,
			},
		},
		methods: {},
	};
</script>

<style lang="scss" scoped>
	.wrap-publisher {
		width: 100%;
		overflow: hidden;
		border-radius: 16rpx;
		background-color: #f6f6f6;
		padding: 25rpx;
		box-sizing: border-box;
		gap: 20rpx;

		.file {
			width: 68rpx;
			height: 68rpx;
			overflow: hidden;
			border-radius: 50%;
		}

		.info {
			flex: 1;
			overflow: hidden;
			gap: 13rpx;

			.title {
				--limit-num: 1;
				color: #252525;
			}
		}

		.btn {
			height: 53rpx;
			border-radius: 27rpx;
			border: 2rpx solid $theme-color;
			color: $theme-color;
			padding: 0 20rpx;
			gap: 10rpx;

			.share {
				width: 24rpx;
				height: 24rpx;
			}
		}
	}
</style>
